/**
 * @ResponseObject.java  COPYRIGHT xiaojian
 * 
 * Created on 2020年3月3日 上午10:24:24
 */
package xj.toolkit.base;

/**
 * mvc开发过程中返回给客户端的对象。
 * 
 * @author <a href="mailto:cxj2000@gmail.com">xiaojian.cao</a>
 *
 */
public class ResponseObject<T> {

	public int code;
	
	public String desc;
	
	public ResponseObject<T> setResultCode(ResultCode code) {
		this.code = code.getResultCode();
		this.desc = code.getDescription();
		
		return this;
	}
	
	public ResultCode resultCode() {
		return new BaseResultCode(code, desc);
	}
	
	public T data;
	
	public ResponseObject<T> setData(T data) {
		this.data = data;
		return this;
	}
	
}
